import request from '@/utils/request'

//查询数据图层分类树
export function getMenuList() {
    return request({
        url: '/basDatManage/getMenuList',
        method: 'get',
    })
}

//查询版本列表
export function getVersionList(query) {
    let dataRangeCountry = query.dataRangeCountry;
    let dataRangeProvince = query.province;
    let dataRangeCity = query.city;
    let dataRangeArea = query.area;
    let dataType2 = query.dataType2;
    // let dataType2 = '57';
    let versionCode = query.versionCode;
    return request({
        url: '/basDatManage/getVersionList?dataRangeCountry='+dataRangeCountry+"&dataRangeProvince="+dataRangeProvince+"&dataRangeCity="+dataRangeCity+"&dataRangeArea="+dataRangeArea+"&dataType2="+dataType2+"&versionCode="+versionCode,
        method: 'get'
    })
}

//查询版本号对应图层数据
export function getListAndGeom(query) {
    // let versionCode = 'JC01XZQH20230713001' //query.versionCode;
    // let typeCode = 'sjxzzx' //query.typeCode;
    let versionCode = query.versionCode;
    let typeCode = query.typeCode;
    let page = query.page;
    let rows = query.rows;
    return request({
        url: '/basDatManage/getListAndGeom?versionCode='+versionCode+'&typeCode='+typeCode+'&page='+page+'&rows='+rows,
        method: 'get'
    })
}

//根据ID查询数据属性表
export function queryDataById(query) {
    let id = query.id;
    let typeCode = query.typeCode;
    return request({
        url: 'datacenter/sysDataVersion/queryDataById?id='+id+"&typeCode="+typeCode,
        method: 'get'
    })
}

//获取全部数据类别列表（二级列表）--用于添加数据
export function getLevel3Sjlb() {
    return request({
        url: 'test/dictItems/getLevel3/sjlb',
        method: 'get'
    })
}

//获取数据类别一级列表
export function getLevel1Sjlb() {
    return request({
        url: 'test/dictItems/getDictItemByDictCode/sjlb',
        method: 'get'
    })
}